package net.mysoft.framework.util;

import java.util.Iterator;
import java.util.List;

import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

public class ParseXML {  
		public static void parserXml(String fileName) {   
			SAXReader reader=new SAXReader(false);    
			try {   
				Document doc=reader.read(ParseXML.class.getResourceAsStream("/pgpConf.xml"));  
				List nodes=doc.selectNodes("pgp/userlist/item");  
		        Iterator it=nodes.iterator();  
		        while(it.hasNext()){  
		          Element elm=(Element)it.next();        
		          //System.out.println("index:"+elm.attributeValue("index")+" level:"+elm.attributeValue("level")+" nickname:"+elm.attributeValue("nickname")+" country:"+elm.attributeValue("country")+" weiwang:"+elm.attributeValue("weiwang"));
		        }  
			}catch (Exception e) {   
				e.printStackTrace();   
			}    
		}   
		
		public static void main(String[] args){
			ParseXML.parserXml("");
		}
}
